﻿using System;

namespace ExFlash.Tags
{
    public class CsmTextSettingsTag : Tag
    {
        public ushort TextId
        {
            get;
            protected set;
        }

        public UseFlashTypes UseFlashType
        {
            get;
            protected set;
        }

        public GridFits GridFit
        {
            get;
            protected set;
        }

        public Single Thickness
        {
            get;
            protected set;
        }

        public Single Sharpness
        {
            get;
            protected set;
        }

        public CsmTextSettingsTag(int len, int offset)
            : base(TagCodes.CSMTextSettings, len, offset)
        {

        }

        public override void SwfDeserialize(BinaryBitReader reader)
        {
            TextId = reader.ReadUInt16();

            UseFlashType = (UseFlashTypes)reader.ReadUInt32(2);
            GridFit = (GridFits)reader.ReadUInt32(3);
            reader.SkipBits(3);
            reader.AlignBits();

            Thickness = reader.ReadSingle();
            Sharpness = reader.ReadSingle();
            
            reader.Position += 1;
        }

        public override void SwfSerialize(byte[] arr, ref int offset)
        {
            throw new NotImplementedException();
        }
    }
}
